package emulator.hardware.video.test;

import java.util.Observer;

import emulator.hardware.clock.Clock;
import emulator.hardware.clock.ClockHandle;

public class CountingClock implements Clock {
	
	private int counter = 0;
	private CountingClockHandle handle_instance = new CountingClockHandle(this);

	@Override
	public ClockHandle acquireHandle() {
		return handle_instance;
	}

	@Override
	public void releaseHandle(ClockHandle handle) {
		/* NOP */
	}
	
	public int getCounterValue()
	{
		return counter;
	}

	void count(int i)
	{
		counter+=i;
	}

	@Override
	public void addClockSpeedObserver(Observer clockSpeedObserver) {
		// TODO Auto-generated method stub
		
	}
}
